<template>
	<view class="mains u-flex caozuo">
		<view class="box" v-for="item in agent_idlist" :key="item.id">
			<navigator :url="item.to">
				<div 
				:style="{backgroundImage:'url('+item.icons+')'}"
				>
					{{item.text}}
				</div>
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				agent_idlist:[
					{
						id:1,
						icons:this.$url+"/upload/icons/tianjiayouhu.png",
						text:"添加客户",
						to:"/pages/shop/add1"
					},
					{	
						id:2,
						icons:this.$url+"/upload/icons/dianpuguanli.png",
						text:"添加店铺",
						to:"/pages/shop/addshop"
					},
					{
						id:3,
						icons:this.$url+"/upload/icons/chongzhi.png",
						text:"客户充值记录",
						to:"/pages/shop/history"
					},
					{
						id:4,
						icons:this.$url+"/upload/icons/tixian.png",
						text:"客户提现记录",
						to:"/pages/shop/historytixian"
					},
					{
						id:5,
						icons:this.$url+"/upload/icons/tianjiayouhu.png",
						text:"店铺运营数据",
						to:"/pages/shop/index"
					},
					
				],
			}
		},
		created() {
			var that=this
			wx.getStorage({
				key:"agent_id",
				success() {
				},
				fail(){
					wx.getStorage({
						key:"customer_id",
						success() {
							that.agent_idlist=that.agent_idlist
							return false
						},
						fail(){
							that.shenfen=3
							that.agent_idlist=[
						{
						id:1,
						icons:that.$url+"/upload/icons/tianjiayouhu.png",
						text:"简单介绍",
						// to:""
						},
						{
						id:2,
						icons:that.$url+"/upload/icons/tianjiayouhu.png",
						text:"案例展示",
						// to:""
						},
						{
						id:3,
						icons:that.$url+"/upload/icons/tianjiayouhu.png",
						text:"关于我们",
						// to:"/pages/shop/index"
						},
						{
						id:4,
						icons:that.$url+"/upload/icons/tianjiayouhu.png",
						text:"登录注册",
						to:"/pages/index/login"
						},
						{
						id:5,
						icons:that.$url+"/upload/icons/tianjiayouhu.png",
						text:"扫码授权绑定",
						to:"/pages/user/custwanshan"
						},
						]
							console.log("游客身份");
							console.log(that.agent_idlist);
						}
					})
					
				}
			})
		}
	}
</script>

<style scoped lang="scss">
	.box{
		border: 1px solid $gary;
		 width: calc(100% / 3);
		// flex: 1;
		background-color: $f;
		box-sizing: border-box;
	}
	.mains{
		width: 100%;
	}
	.caozuo {
		flex-wrap: wrap;
		div {
			height: 210upx;
			background-size: 60upx;
			background-repeat: no-repeat;
			background-position: 50% 50%;
			text-align: center;
			line-height: 325upx;
		}
	}
</style>
